<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Hello React!</title>
    <script src="./react.min.js"></script>
    <script src="./react-dom.min.js"></script>
    <script src="https://cdn.bootcss.com/babel-standalone/6.22.1/babel.min.js"></script>
  </head>
  <body>
    <div id="example"></div>
    <!-- <script type="text/babel">
    var Content = React.createClass({
      render: function() {
        return  <div>
                  <button onClick = {this.props.updateStateProp}>点我</button>
                  <h4>{this.props.myDataProp}</h4>
               </div>
      }
    });
    var HelloMessage = React.createClass({
      getInitialState: function() {
        return {value: 'Hello Runoob!'};
      },
      handleChange: function(event) {
        this.setState({value: '菜鸟教程'})
      },
      render: function() {
        var value = this.state.value;
        return <div>
                <Content myDataProp = {value} 
                  updateStateProp = {this.handleChange}></Content>
               </div>;
      }
    });
    ReactDOM.render(
      <HelloMessage />,
      document.getElementById('example')
    );
    </script> -->
    <script type="text/babel">
      var Content = React.createClass({
      render: function() {
        return  <div>
                  <button onClick = {this.props.updateStateProp}>点我</button>
                  <h4>{this.props.myDataProp}</h4>
               </div>
      }
    });
      var HelloMessage=React.createClass({
       getInitialState: function(){
        return {value: 'Hello Runoob!'};
       },
       handleChange: function(event){
        this.setState({value: '菜鸟教程'})
       },
       render: function(){
        var value=this.state.value;
        return <div>
           <Content myDataProp={value} updateStateProp={this.handleChange}></Content>
        </div>;
       }
      });
      ReactDOM.render(
       <HelloMessage />,
       document.getElementById('example')
      );
    </script>
  </body>
</html>